package com.nyc.controller;

import com.nyc.event.MyEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author niuyicong
 * @date 2025/8/29  14:47:27
 * @description
 */
@RestController
public class UserController {

    @Autowired
    private ApplicationContext context;

    @GetMapping("/hello")
    public String hello(){
        context.publishEvent(new MyEvent(new Object()));
        return "hello";
    }
}
